import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {join} from 'path'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': join(__dirname, "src")
        }
    },
    server: {
        host: '0.0.0.0',
        port: '5900',
        https: false
    },
    proxy: {
        '/api': {
            // 后台地址
            target: 'http://127.0.0.1:8990/',
            changeOrigin: true,
            rewrite: path => path.replace(/^\/api1/, '')
        },
        '/api2': {
            // 后台地址
            target: 'http://127.0.0.1:8956/',
            changeOrigin: true,
            rewrite: path => path.replace(/^\/api2/, '')
        }
    }
})
